﻿@model WeProjects.Models.ProjectViewModel

@{
    ViewBag.Title = "Delete";
    int userId = int.Parse(Membership.GetUser().ProviderUserKey.ToString());
    @*不是组长，也不是管理员*@
    if(!Roles.IsUserInRole("sysadmin") && Model.OwnerID!=userId)
    {
        Response.Write("当前用户没有权限操作");
        Response.End();
    }
}
@*@Html.Partial("_projectMenu", Model.ID)*@
<h2>@Model.Title > 删除项目</h2>
<p class="buttonIn">
    @Html.ActionLink("返回列表", "Index")
</p>

<div class="bs-callout bs-callout-danger">
    <h4>确认删除这个项目?</h4>
    <p>项目名称：@Html.DisplayFor(model => model.Title)</p>    
    <p>
        项目任务数：@Html.DisplayFor(model=>model.TaskCount)
        项目新闻数：@Html.DisplayFor(model => model.NewsCount)
        @*项目文件数：@Html.DisplayFor(model => model.DocumentCount)*@
        项目成员数：@Html.DisplayFor(model => model.MemberCount)
    </p>
@if(Model.TaskCount==0&&Model.NewsCount==0&&Model.MemberCount==0)
{ 
    using (Html.BeginForm())
    {
        @Html.AntiForgeryToken()
        <p>
            <input type="submit" value="Delete" class="btn btn-danger width-20p" />
        </p>
    }
}
else
{
    <p><h4>项目关联内容数必须全部为0，才可删除。请首先删除关联内容。</h4></p>
}
</div>